<template>
  <div class="container contract-review pb">
    <p class="bread">
      <a href="#/index/lms-order-list">法律服务监控员-订单管理</a> >
      <a href="javascript:void(0);" class="font-s-18">法律服务通知单</a>
    </p>
    <div class="bg-c-fff box-border">
      <h3 class="tm-title">法律服务</h3>
      <step :stepData="stepData" :stepNum="stepNum" @stepRouter="stepRouter"></step>
    </div>
    <form action="" class="content">
      <div class="bg-c-fff box-border box">
        <p class="tc title">
          法律服务通知单
        </p>
        <ul class="fix box-border-top monitor-box">
          <li class="flo-left tc">律师信息</li>
          <li class="flo-right fix">
            <p>{{lawyerName}}</p>
            <p>{{lawFirmName}}</p>
          </li>
        </ul>
        <ul class="fix box-border-top monitor-box">
          <li class="flo-left tc">客户信息</li>
          <li class="flo-right fix">
            <p>{{customerName}}</p>
          </li>
        </ul>
        <ul class="fix box-border-top monitor-box">
          <li class="flo-left tc">法律服务内容</li>
          <li class="flo-right fix">
            <textarea v-model="con" disabled></textarea>
          </li>
        </ul>
        <ul class="fix box-border-top monitor-box">
          <li class="flo-left tc">法律服务合同</li>
          <li class="flo-right fix">
            <a :href="contractUrl" target="_blank" class="contract">查看合同</a>
          </li>
        </ul>
        <ul class="fix box-border-top monitor-box">
          <li class="flo-left tc">合同标价</li>
          <li class="flo-right fix">
            <input type="number" placeholder="请输入数字" class="input-css" v-model.number="money" disabled>
            <i class="iconfont icon-asterisk"></i>
            <span>元</span>
          </li>
        </ul>
      </div>
      <div class="box bg-c-fff box-border auto tc button" v-show="this.status<=2">
        <input type="button" value="下一步" class="blue-button" v-on:click="onBindClick">
      </div>
    </form>
  </div>
</template>
<script type="text/javascript">
import Step from '../components/Step'
export default {
  components: {
    Step
  },
  data() {
    return {
      stepNum: 0,
      stepData: [{
        name: '法律服务通知单'
      }, {
        name: '绘制流程图'
      }, {
        name: '法律服务监控'
      }, {
        name: '服务完成'
      }],
      con: '',
      money: '',
      contractUrl: '',
      id: '',
      status: 0,
      lawyerName: '',
      lawFirmName: '',
      customerName: ''
    }
  },
  mounted() {
    this.id = this.$route.query.id
    this.getData()
    this.$http.get('/legalService/read/detail', {
      params: {
        id: this.$route.query.id
      }
    }).then(data => {
      if (data.data.httpCode === 200) {
        this.status = data.data.data.status
      } else {
        this.$toasted.show(data.data.msg)
      }
    }).catch(err => {
      console.log(err)
      this.$toasted.show('网络出错')
    })
  },
  methods: {
    onBindClick() {
      this.$router.push('/lms-order-mapping?id=' + this.id)
    },
    getData() {
      this.$http.get('/legalService/read/detail', {
        params: {
          id: this.id
        }
      }).then(data => {
        if (data.data.httpCode === 200) {
          this.con = data.data.data.content
          this.money = data.data.data.contractPrice / 100
          this.contractUrl = data.data.data.contract
          this.status = data.data.data.status
          this.lawyerName = data.data.data.lawyerName
          this.lawFirmName = data.data.data.lawFirmName
          this.customerName = data.data.data.customerName
        } else {
          this.$toasted.show(data.data.msg)
        }
      }).catch(err => {
        console.log(err)
        this.$toasted.show('网络出错')
      })
    },
    stepRouter(i, name) {
      if (i === 0 && this.status >= 2) {
        this.$router.push('/lms-order-notice?id=' + this.$route.query.id)
      }
      if (i === 1 && this.status === 2) {
        this.$router.push('/lms-order-mapping?id=' + this.$route.query.id)
      }
      if (i === 1 && this.status > 2) {
        this.$toasted.show('请点击法律服务监控查看')
      }
      if (i === 2 && this.status >= 3) {
        this.$router.push('/lms-order-monitor?id=' + this.$route.query.id)
      }
      if (i === 3 && this.status >= 4) {
        this.$router.push('/lms-order-finish?id=' + this.$route.query.id)
      }
    }
  }
}

</script>
<style type="text/css" scoped>
.contract {
  display: inline-block;
  margin-top: 8px;
  color: #01378c;
  text-decoration: underline;
}

.box-border {
  border: 1px solid #ddd;
}

.tm-title {
  line-height: 40px;
  padding-left: 35px;
  font-size: 14px;
  color: #282828;
  border-bottom: 1px solid #ddd;
}

.content .box {
  margin-top: 20px;
}

.pb {
  padding-bottom: 70px;
}

.button .white-button,
.button .blue-button {
  width: 245px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  margin: 40px 15px;
}

.content .box .box-border-top {
  border-top: 1px solid #ddd;
}

.content .box ul li.flo-left {
  border-right: 1px solid #dddddd;
  width: 396px;
}

.content .box ul li.flo-right {
  width: 800px;
  padding: 20px 0 20px 100px;
}

.content .box ul li.flo-right p {
  line-height: 30px;
}

form .monitor-box:nth-of-type(1) li.flo-left {
  line-height: 100px;
}

form .monitor-box:nth-of-type(3) li.flo-left {
  line-height: 150px;
}

form .monitor-box:nth-of-type(2) li.flo-left {
  line-height: 70px;
}

form .monitor-box:nth-of-type(4) li.flo-left {
  line-height: 75px;
}

form .monitor-box:nth-of-type(4) li.flo-left .blue-button {
  width: 100px;
  height: 40px;
}

form .monitor-box:nth-of-type(5) li.flo-left {
  line-height: 80px;
}

form .monitor-box:nth-of-type(3) textarea {
  width: 350px;
  height: 100px;
  padding: 10px 8px;
  border: 1px solid #ddd;
}

.icon-asterisk {
  color: #ec5303;
  font-size: 28px;
  position: relative;
  left: -30px;
  top: 6px;
}

.monitor-box li span {
  margin-left: -26px;
}

p.title {
  height: 40px;
  line-height: 40px;
}

.monitor-box .paid {
  margin-left: 10px;
}

</style>
